π Linked List
Linked lists test pointer dexterity. Almost every problem reduces to: traverse with a dummy head, manipulate
prev/curr/nextcarefully, or run two pointers at different speeds.
This category contains 27 problems. Use the patterns below to recognize what's being asked, then jump to the problem list at the bottom.
π§ Key Patternsβ
- Dummy Head β Simplifies edge cases when the head itself changes (merge, remove-Nth).
- Fast & Slow Pointers β Cycle detection, find middle, kth-from-end.
- In-place Reversal β
prev/curr/nextswap β the classic interview move. - Merge Two / K Sorted Lists β Two pointers (k=2) or min-heap (k>2).
- Recursion on Lists β Many problems become a 3-line recursive solution.
β οΈ Common Pitfallsβ
- Losing the list β always cache
nextbefore reassigning pointers. - Off-by-one with
n + 1gap in the two-pointer remove-Nth pattern. - Forgetting to break the cycle when detecting and removing one.
π Study Resourcesβ
πΊ Videosβ
π Booksβ
- Cracking the Coding Interview β Ch. 2 (Linked Lists)
- Elements of Programming Interviews β Ch. 7
π Articles & Referencesβ
π» All Linked List Problemsβ
Add Two Numbers
LeetCode 2 | Difficulty: Medium
Add Two Numbers II
LeetCode 445 | Difficulty: Medium
Delete Node in a Linked List
LeetCode 237 | Difficulty: Medium
Delete the Middle Node of a Linked List
LeetCode 2216 | Difficulty: Medium
Insertion Sort List
LeetCode 147 | Difficulty: Medium
Intersection of Three Sorted Arrays
LeetCode Link
Intersection of Two Arrays
LeetCode 349 | Difficulty: Easy
Intersection of Two Arrays II
LeetCode 350 | Difficulty: Easy
Intersection of Two Linked Lists
LeetCode 160 | Difficulty: Easy
Interval List Intersections
LeetCode 1028 | Difficulty: Medium
Linked List Cycle
LeetCode 141 | Difficulty: Easy
Linked List Cycle II
LeetCode 142 | Difficulty: Medium
Maximum Twin Sum of a Linked List
LeetCode 2236 | Difficulty: Medium
Merge k Sorted Lists
LeetCode 23 | Difficulty: Hard
Merge Two Sorted Lists
LeetCode 21 | Difficulty: Easy
Middle of the Linked List
LeetCode 908 | Difficulty: Easy
Odd Even Linked List
LeetCode 328 | Difficulty: Medium
Palindrome Linked List
LeetCode 234 | Difficulty: Easy
Remove Linked List Elements
LeetCode 203 | Difficulty: Easy
Remove Nth Node From End of List
LeetCode 19 | Difficulty: Medium
Remove Zero Sum Consecutive Nodes from Linked List
LeetCode 1267 | Difficulty: Medium
Reorder List
LeetCode 143 | Difficulty: Medium
Reverse Linked List
LeetCode 206 | Difficulty: Easy
Reverse Linked List II
LeetCode 92 | Difficulty: Medium
Rotate List
LeetCode 61 | Difficulty: Medium
Sort List
LeetCode 148 | Difficulty: Medium
Swap Nodes in Pairs
LeetCode 24 | Difficulty: Medium